/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.training.enums;

import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;

/**
 * @Author: laiguangming
 * @Date: 2023/3/9 10:43
 */
public enum GradeStatus {

    /**
     * 未开始
     */
    NOT_START(0, "notStart"),

    /**
     * 培训中
     */
    STUDYING(1, "studying"),

    /**
     * 培训完成
     */
    FINISHED(2, "finished");


    /**
     * gradeStatus
     */
    private final int value;

    /**
     * gradeStatusCode
     */
    private final String code;

    GradeStatus(int value, String code) {
        this.value = value;
        this.code = code;
    }

    public int getValue() {
        return value;
    }

    public String getCode() {
        return code;
    }

    /**
     * 获取枚举的 BiMap
     * @return
     */
    public static BiMap<Integer, String> getBiMap() {
        BiMap<Integer, String> biMap = HashBiMap.create();
        GradeStatus[] enums = GradeStatus.values();
        for (GradeStatus gradeStatus : enums) {
            biMap.put(gradeStatus.getValue(), gradeStatus.getCode());
        }
        return biMap;
    }

}
